package pl.softech.gpw.candles.editor.dad;

import java.awt.datatransfer.Transferable;

import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.TransferHandler;

import pl.softech.gpw.candles.editor.CandlestickWidget.CWidget;

public class CWidgetTransferHandler extends TransferHandler {

    private static final long serialVersionUID = 1L;
    
    @Override
    public boolean canImport(TransferSupport support) {
        return false;
    }

    @Override
    protected Transferable createTransferable(JComponent c) {
        CWidget cWidget = (CWidget) c; 
        return new CWidgetTransferable(cWidget.getCandlestickWidget());
    }

    @Override
    public Icon getVisualRepresentation(Transferable t) {
        return super.getVisualRepresentation(t);
    }

    @Override
    public int getSourceActions(JComponent c) {
        return COPY;
    }
    
    
    
    
}
